<%= form_tag({:action=> "search", :method => 'get'}) %>
<table>
    <tr>
        <td>
            <label for="searchtext">
                <font size="1">
                    <b>Live TR Search:</b>
                </font>
            </label>
        </td>
        <td>
            <%= text_field_tag :search, params[:buscador] %>
        </td>
        <td>
            <%= submit_tag "search", :name => nil %>
        </td>
        <td>
            <img alt="spinner" id="spinner" src="http://www.charleston.co.ke/img/spinner.gif" style="display:none;"/>
        </td>
    </tr>
</table>
</form><!--
<%= observe_field(:searchtext,
:frequency => 0.5,
:update => :search_hits,
:loading => "Element.show('spinner')",
:complete => "Element.hide('spinner')",
:with => "searching",
:url => { :action => :live_search }) %>
-->
<div id="search_hits">
    <% if @results.empty? %>
    '<%=h @phrase %>' not found!<% else %>
    <table border="1">
        <tr>
            <th align='left'>
                Nombre del caballo
            </th>
            <th align='left'>
                Sexo
            </th>
            <th align='left'>
                Año de nacimiento
            </th>
            <th align='left'>
                Acciones
            </th>
        </tr>
        <% @results.each do |horse| %>
        <tr onmouseover="this.style.background='#BEE696'",  onmouseout="this.style.background='white'" bgcolor="white">
            <td width='250px' height="32px">
                <%=h horse.horse_name %>
            </td>
            <td width='150px' height="32px">
                <%=h horse.horse_sex_id %>
            </td>
            <td width='200px' height="32px">
                <%=h horse.born %>
            </td>
            <td width='150px' height="32px">
                <%= link_to '<img src="images/profile.png" border="0px" align="left" style="padding-right:10px"; alt="Ver Perfiel" title="Ver Perfiel">', horse,:class=>'opacityit' %>
                <%= link_to '<img src="images/edit.png" border="0px" align="left" style="padding-right:10px" alt="Editar" title="Editar Perfiel">', edit_horse_path(horse),:class=>'opacityit' %>
            </td>
        </tr>
        <% end %>
    </table>
    <%=will_paginate @results %>
    <% end %>
</div>
